<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <script>
        function fireEvent(element,event){
        if (document.createEventObject){
        // dispatch for IE
        var evt = document.createEventObject();
        return element.fireEvent('on'+event,evt)
        }
        else{
        // dispatch for firefox + others
        var evt = document.createEvent("HTMLEvents");
        evt.initEvent(event, true, true ); // event type,bubbling,cancelable
        return !element.dispatchEvent(evt);
        }
    }
            
         var t=this.setTimeout(doRedirect, 10000);
         var i=this.setInterval(renderSecs, 1000);
         var sec=10
         function renderSecs() {
         document.getElementById("redirect:sec").innerHTML=--sec;
         }
         function doRedirect() {
          clearTimeout(t);
          clearTimeout(i);
          
          command=document.getElementById("redirect:er");
          fireEvent(command,"click")
           
         }
        </script>
    </h:head>

    <h:body>
            <h:form id="redirect">
                <h:commandLink id="er" action="/index.xhtml" >${frontController.calcError()}</h:commandLink>
                <h:outputLabel id="seclable" value="${bundle.Redirectin}"/><h:outputLabel id="sec" value=" "/>
        </h:form>
    </h:body>

</html>
